#include "StdAfx.h"
#include "UIButtonCtrl.h"

UIButtonCtrl::UIButtonCtrl(void)
{
	SetPos(400.0f, 300.0f);
	SetSize(100.0f, 100.0f);
}

UIButtonCtrl::~UIButtonCtrl(void)
{
}

void UIButtonCtrl::InitVertexBuffer()
{
	UIControl::InitVertexBuffer();
}

void UIButtonCtrl::Render()
{
	UIControl::Render();
}

void UIButtonCtrl::ReleaseBuffer()
{
	UIControl::ReleaseBuffer();
}

void UIButtonCtrl::Frame()
{
	UIControl::Frame();
	if(m_IsSelet)
	{
		ChangeSeletColor();
	}
	else
	{
		ChangeDefaultColor();
	}
}

void UIButtonCtrl::Run()
{
	Frame();
	Render();
}

void UIButtonCtrl::ChangeSeletColor()
{
	SetColor(0xff00ff00);
}

void UIButtonCtrl::ChangeDefaultColor()
{
	SetColor(0xffff0000);
}

